package exception;

public class ThrowDemo {
    public static void main(String[] args) throws Exception {
        Person p = new Person();
        //p.setAge(10);
        try {
            p.setAge(1111);//违背设计要求
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("出错了");
        }

        System.out.println("此人年龄：" + p.getAge());
    }
}
